package 学生管理;

import java.util.ArrayList;
import java.util.Scanner;

public class XiTong {
    Scanner scan = new Scanner(System.in);
    ArrayList<getandset> getandsetArrayList = new ArrayList<>();
    public void print() {
        for (int i = 0; i < getandsetArrayList.size(); i++) {
            getandset getandset = getandsetArrayList.get(i);
        }
    }

   public void add(){

       System.out.println("请输入学生姓名:");
       String name = scan.next();
       System.out.println("请输入学生的年龄:");
       int age = scan.nextInt();
       getandset getandset = new getandset();
       getandset.setName(name);
       getandset.setAge(age);
       getandsetArrayList.add(getandset);

   }
}
